package PagePackage;






import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;



public class newUserPageClass extends internalPageClass {
	
	
	@FindBy (name="firstName")
	public WebElement firstNamefield;
	
	@FindBy (name="lastName")
	public WebElement lastNamefield;
	
	@FindBy (name="email")
	public WebElement emailfield;
	
	@FindBy (name="phone1")
	public WebElement phone1field;
	
	@FindBy (name="phone2")
	public WebElement phone2field;
	
	@FindBy (className="btn-next")
	public WebElement nextstepbutton;
	
	@FindBy (className="btn-add-new")
	public WebElement addNewUserButton;
	
	
	
	public userRolePageClass createNewUser(String firstname, String lastname, String email, String phone1, String phone2) {
		userstab.click();//click User tab
		addNewUserButton.click(); //click "Add New User"
		 
		 
		firstNamefield.sendKeys(firstname); //enter first name
		lastNamefield.sendKeys(lastname);  //enter last name
		emailfield.sendKeys(email); //enter email
		phone1field.sendKeys(phone1); //enter phone1
		phone2field.sendKeys(phone2); //enter phone2
		nextstepbutton.click(); //Click Create New Button 
		
		return MyPageFactory.getPage(driver, userRolePageClass.class);
	}
	
	/*public boolean isOnThisPage(){
		return firstNamefield.isDisplayed();
	}
	@Override
	void tryToOpen() {
		MyPageFactory.getPage(driver, loginPageClass.class).loginAs("victoria@krossover.com", "webmaster");
	
	}*/

}
